#include <iostream>

using namespace std;

class parent {
public:
        void foo(void) {cout << "parent::foo()" << endl;}
};

class child : public parent {
public:
        void foo(void) {cout << "child::foo()" << endl;}
};

int main()
{
        parent a;
        child b;

        a.foo();
        b.foo();

        parent *p = &b;
        p->foo();

        cout << "sizeof(parent) = " << sizeof(parent) << endl;
        cout << "sizeof(child) = " << sizeof(child) << endl;

        return 0;
}
